package com.thinkcube.edutainment.fragment;

import android.app.Fragment;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.thinkcube.edutainment.R;
import com.thinkcube.edutainment.SearchListFragment;
import com.thinkcube.edutainment.SearchListFragment_;


public class SearchFragment extends Fragment {
	
	

	 @Override
	 public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
	  
		  View myFragmentView = inflater.inflate(R.layout.search_fragment_view, container, false);
		  String SeachText="";
		  if(getArguments().containsKey("searchText"))
		  {
			  SeachText=getArguments().getString("searchText");
		  }
		  
		  SearchListFragment searchList=new SearchListFragment_();
		  
		  SearchDetailFragment sDetails=new SearchDetailFragment_();
		  
		  Bundle bundal=new Bundle();
		  bundal.putString("searchText", SeachText);
		 // bundal.putString("item_id", "1");
		  sDetails.setArguments(bundal);
		  
		  final FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
		  
		  fragmentTransaction.add(R.id.search_list1, searchList,"newfrag");
		  fragmentTransaction.add(R.id.search_detail_container1, sDetails,"newfrag");

		  fragmentTransaction.commit();
	  
	  return myFragmentView;
	 }
	 
	
}
